package dfbz.线程通信;

public class Test {
    public static void main(String[] args) throws InterruptedException {
        Shower shower = new Shower();
       new Thread(){
           @Override
           public void run() {
               try {
                   shower.shower1();
               } catch (InterruptedException e) {
                   e.printStackTrace();
               }
           }
       }.start();

        new Thread(){
            @Override
            public void run() {
                try {
                    shower.shower2();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }.start();

        new Thread(){
            @Override
            public void run() {
                try {
                    shower.shower3();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }.start();

    }
}
